#pragma once
#include <interface/aot_voip_interface.h>

class voip_driver;

class voip_svc_impl : public aot::voip::ivoip_svc
{
public:
	voip_svc_impl();
	virtual ~voip_svc_impl();
public:
	virtual void destroy() {;}
public:
	//virtual bool putq(aot::im::iim_packet* pkt);
public:
	virtual bool init();

	virtual bool reg(const char* user_name, const char* passwd);
	virtual bool unreg();

	virtual const char* call(const char* callee_nbr);
	virtual bool accept(const char* callid);
	virtual bool reject(const char* callid);
	virtual bool answer(const char* callid);
	virtual bool hangup(const char* callid);

	virtual bool hold(const char* callid);
	virtual bool unhold(const char* callid);

	virtual bool record_start(const char* callid, const char* rec_file);
	virtual bool record_pause(const char* callid, bool is_paused);
	virtual bool record_stop(const char* callid);

	virtual bool play_file_to_remote(const char* callid, const char* play_file, bool loop = 0);
	virtual bool stop_play_to_remote(const char* callid);

	virtual bool start_3p_conf(const char* ch1_callid, const char* ch2_callid);
	virtual const char* invite_3p_conf(const char* ch1_callid, const char* callee_nbr);
	virtual bool hangup_3p_conf(const char* callid);
	//bool redirect(const char* remote_nbr, const char* direct_uri);

	void set_wave_out_dev(const char* wave_out_dev = NULL);
	void set_wave_in_dev(const char* wave_in_dev = NULL);
	void agc_enable(int enable);

public:
	voip_driver *voip_driver_;
};
